package com.zy.controller;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.zy.entity.Dict;
import com.zy.service.CustomerService;
import com.zy.service.impl.CustomerServiceImpl;

/**
 * Servlet implementation class ToAddServlet
 */
@WebServlet("/ToAddServlet")
public class ToAddServlet extends HttpServlet {
	
      //创建service对象
	CustomerService cs=new CustomerServiceImpl();
 
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		//查询级别
		List<Dict> dict = cs.getDict();
		
		//存域
		request.setAttribute("list", dict);
		
		//跳转到新增页面
		request.getRequestDispatcher("/WEB-INF/customer/add.jsp").forward(request, response);
		
	}

	
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}

}
